#pragma once

namespace Maths
{
	const double PI			= 3.1415926535897932384626433832795028841971693993751;
	const double HALFPI 	= PI/2.0;
	const double INVPI		= 1.0/PI;
	const double DEGTORAD	= PI/180.0;
	const double RADTODEG	= 180.0/PI;
	const double EPSILON	= 1e-6;
	
	bool Equals( float value1, float value2, float tolerance );
	bool Equals( double value1, double value2, double tolerance );
	inline float Clamp(float x, float a, float b);
	inline double Clamp(double x, double a, double b);
	void CrossProduct(float* out, float* b, float* c);
	float Dot( float* a, float* b );
	void Normalize(float *a);
};

inline float Maths::Clamp(float x, float a, float b)
{   
	return x < a ? a : (x > b ? b : x);
};

inline double Maths::Clamp(double x, double a, double b)
{   
	return x < a ? a : (x > b ? b : x);
};
